package com.bailun91.auth.config;


import com.bailun91.auth.dto.RoleDto;
import com.bailun91.auth.dto.UserDto;
import com.bailun91.auth.entity.User;
import com.bailun91.auth.mapper.UserMapper;
import com.bailun91.auth.util.MD5Utils;
import org.apache.shiro.authc.*;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.authz.SimpleAuthorizationInfo;
import org.apache.shiro.realm.AuthorizingRealm;
import org.apache.shiro.subject.PrincipalCollection;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.ArrayList;
import java.util.List;


public class ShiroRealm extends AuthorizingRealm {


    @Autowired
    private UserMapper userMapper;

    /*
     * 获取用户角色和权限
     */
    @Override
    protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principal) {
        System.out.println("授权");

        return null;
    }

    /**
     * 登录认证
     */
    @Override
    protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
        System.out.println("开始登录认证");

        return null;
    }

}
